<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-12 col-sm-2">{:__('Question_id')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
            <!--<input id="c-question_id" data-rule="required" data-source="question/index" class="form-control selectpage" name="row[question_id]" type="text" value="{$row.question_id|htmlentities}">-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
            <!--<input id="c-num" data-rule="required" class="form-control" name="row[num]" type="text" value="{$row.num|htmlentities}">-->
        <!--</div>-->
    <!--</div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input class="sta" onclick="CheckedMarket1(this)" id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group max" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('用户最多只能选择')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-max"  class="form-control" name="row[max]" type="text" value="{$row.max|htmlentities}">
        </div>
    </div>
    <div class="form-group option">
        <label class="control-label col-xs-12 col-sm-2">{:__('Option')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-option" class="form-control " rows="5" name="row[option]" cols="50">{$row.option|htmlentities}</textarea>
        </div>
    </div>
    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-12 col-sm-2">{:__('T_option')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
            <!--<textarea id="c-t_option" class="form-control " rows="5" name="row[t_option]" cols="50">{$row.t_option|htmlentities}</textarea>-->
        <!--</div>-->
    <!--</div>-->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script src="/assets/js/jquery-1.8.3.min.js"></script>
<script>
    function CheckedMarket1(obj) {
        var id = $(obj).attr('value');
        if(id == 2){
            $('.max').css("display","block");
        }else{
            $('.max').css("display","none");
        }
        if(id == 3 || id == 5){
            $('.t-option').css("display","none");
        }else{
            $('.t-option').css("display","block");
        }
        if(id == 5){
            $('.t-option').css("display","none");
            $('.option').css("display","none");
            $('.miaoa').css("display","block");
            $('.miaob').css("display","block");
        }else{

            $('.option').css("display","block");

            $('.miaoa').css("display","none");
            $('.miaob').css("display","none");

        }
    }
    $(function () {
        var obj = $('.sta');
        for(k in obj){
            if(obj[k].checked)
                var id = obj[k].value;
        }
        console.log(id);
        if(id == 2){
            $('.max').css("display","block");
        }else{
            $('.max').css("display","none");
        }
        if(id == 3 || id == 5){
            $('.t-option').css("display","none");
        }else{
            $('.t-option').css("display","block");
        }
        if(id == 5){
            $('.t-option').css("display","none");
            $('.option').css("display","none");
            $('.miaoa').css("display","block");
            $('.miaob').css("display","block");
        }else{

                $('.option').css("display","block");

            $('.miaoa').css("display","none");
            $('.miaob').css("display","none");

        }
    })
</script>
